#include <stdio.h>

int main( )
{
    int num;
    while ( scanf("%d", &num) != EOF )
    {
        if ( num == 0 ) break;
        int t1, t2 ,t3, i, t;
        t1 = t2 = t3 = 0;
        t = num;
        for ( i = 0; i < 4; i++ )
        {
            t1 += t % 10;
            t /= 10;
        }
        t = num;
        while ( t )
        {
            t2 += t % 16;
            t /= 16;
        }
        t = num;
        while ( t )
        {
            t3 += t % 12;
            t /= 12;
        }
        if ( t1 == t2 && t2 == t3 )
            printf("%d is a Sky Number.\n", num);
        else
            printf("%d is not a Sky Number.\n", num);
    }
    return 0;
}
